package org.darkforest.model;

import java.util.List;

import org.darkforest.common.util.DateUtil;
import org.darkforest.enums.ReasonIdEnum;
import org.darkforest.enums.RefundStateEnum;
import org.darkforest.enums.SellerStateEnum;

/**
 * 
 * 项目名称         :bwmall-common
 * 文件名           :RefundReturnVo.java
 * 开发公司及作者    :陈超
 * 版本号及开发日期  :Rev. 1.00 (2015年2月20日)
 */
public class RefundReturnVo extends RefundReturn {
	
	private String addTimeStr;

	private String sellerTimeStr;

	private String receiveTimeStr;
	
	private Store store;
	
	private OrderVo order;
	
	private List<OrderGoods> goods;
	
	private OrderPay pay;


	public String getSellerTimeStr() {
		return DateUtil.toIntDateString(super.getSellerTime());
	}

	public void setSellerTimeStr(String sellerTimeStr) {
		this.sellerTimeStr = sellerTimeStr;
	}

	public String getSellerStateStr(){
		SellerStateEnum e = SellerStateEnum.getByValue(super.getSellerState());
		return e == null ? "" : e.getText();
	}

	public String getRefundStateStr(){
		RefundStateEnum e = RefundStateEnum.getByValue(super.getRefundState());
		return e == null ? "" : e.getText();
	}
	
	public String[] getPicInfos(){
		if(super.getPicInfo() == null || super.getPicInfo().trim().equals("")){
			return null;
		}else{
			return super.getPicInfo().split(",");
		}
	}
	
	public void setPicInfos(String[] picInfos){
		String picInfo = null;
		for(String pic : picInfos){
			if(pic != null && !pic.trim().equals("")){
				if(picInfo == null){
					picInfo = "";
				}else if(picInfo.length() > 0){
					picInfo += ",";
				}
				picInfo += pic;
			}
		}
		super.setPicInfo(picInfo);
	}
	

	public Store getStore() {
		return store;
	}

	public void setStore(Store store) {
		this.store = store;
	}

	public String getAddTimeStr() {
		return addTimeStr;
	}

	public void setAddTimeStr(String addTimeStr) {
		this.addTimeStr = addTimeStr;
	}


	public OrderVo getOrder() {
		return order;
	}


	public void setOrder(OrderVo order) {
		this.order = order;
	}


	public List<OrderGoods> getGoods() {
		return goods;
	}


	public void setGoods(List<OrderGoods> goods) {
		this.goods = goods;
	}


	public OrderPay getPay() {
		return pay;
	}


	public void setPay(OrderPay pay) {
		this.pay = pay;
	}
	
	public String getReasonIdStr(){
		ReasonIdEnum e = ReasonIdEnum.getByValue(super.getReasonId());
		return e == null ? "" : e.getText();
	}


	public String getReceiveTimeStr() {
		return receiveTimeStr;
	}

	public void setReceiveTimeStr(String receiveTimeStr) {
		this.receiveTimeStr = receiveTimeStr;
	}
}
